﻿@model PrivateMessageListModel
@using Nop.Web.Extensions;
@using Nop.Web.Models.PrivateMessages;
<div class="private-messages-box">
    @if (Model.Messages.Count > 0)
    {
        <ul data-role="listview" data-inset="true" data-filter="false" data-theme="c">
            @foreach (var pm in Model.Messages)
            {
                <li>
                    <div class="item">
                        <div>
                            @T("PrivateMessages.Inbox.SubjectColumn"): @Html.RouteLink(pm.Subject, "ViewPM", new { privateMessageId = pm.Id }, new { @class = (pm.IsRead) ? "pm-read" : "pm-unread" })
                        </div>
                        <div>
                            @T("PrivateMessages.Inbox.FromColumn"):
                            @if (pm.AllowViewingFromProfile)
                           {
                                <a href="@Url.RouteUrl("CustomerProfile", new { id = pm.FromCustomerId })">@(pm.CustomerFromName)</a>
                           }
                           else
                           {
                                @pm.CustomerFromName
                           }
                        </div>
                        <div>
                            @T("PrivateMessages.Inbox.DateColumn"): @pm.CreatedOn
                        </div>
                    </div>
                </li>
            }
        </ul>
        <div class="pager">
            @Html.Pager(Model.PagerModel)
        </div>
    }
</div>
